﻿@model IEnumerable<ADShop.Models.ImagesProduct>
<script>
    function AddToCart(id) {
        $.post("/ShoppingCart/AddToCart", { "id": id },
            function (data) {
                if (data.Code == 0) {
                    alert("Thêm sản phẩm vào giỏ hàng thành công !");
                }
                else if (data.Code == 1) {
                    alert("Thêm sản phẩm vào giỏ hàng thất bại !");
                }
            }
        )
    }
</script>
<div class="box">
    <div class="box-heading"><span>Featured</span></div>
    <div class="box-content">
        <div class="box-product">
            @foreach (var items in Model)
            {
                <div>
                    <div class="image"><a href="~/DetailsProduct/Details/@items.IDProduct"><img src="@items.LinkImagesProduct" alt="@items.DescriptionImages" width="152" height="152"></a></div>
                    <div class="name"><a href="http://localhost/fullscreen/index.php?route=product/product&amp;product_id=40">@items.Product.NameProduct</a></div>
                    <div class="price"> Listed Price : $@items.Product.ListedPrice </div>
                    <div class="price"> Price : $@items.Product.PriceProduct </div>
                    <div class="rating">
                        @Html.Action("GetRating", "ProductManager", new { id = @items.IDProduct })
                    </div>
                    <div class="cart">
                        <input type="button" value="Add to Cart" onclick="AddToCart(@items.IDProduct);" class="button">
                    </div>
                </div>
            }
        </div>
    </div>
</div>